﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查询所有商品分类信息</title>
    <link rel="shortcut icon" href="<%=application.getContextPath()%>/static/favicon.ico">
    <link href="<%=application.getContextPath()%>/static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="<%=application.getContextPath()%>/static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="<%=application.getContextPath()%>/static/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="<%=application.getContextPath()%>/static/css/animate.min.css" rel="stylesheet">
    <link href="<%=application.getContextPath()%>/static/css/style.min.css?v=4.0.0" rel="stylesheet">

</head>

<body class="gray-bg">
<c:if test="${typeAddMsg != null && !empty typeAddMsg}">
    <script>
        alert("${typeAddMsg}");
    </script>
</c:if>
<c:if test="${typeDeleteMsg != null && !empty typeDeleteMsg}">
    <script>
        alert("${typeDeleteMsg}");
    </script>
</c:if>
<c:if test="${typeUpdateMsg != null && !empty typeUpdateMsg}">
    <script>
        alert("${typeUpdateMsg}");
    </script>
</c:if>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>查询所有商品分类信息</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="table_data_tables.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="table_data_tables.html#">选项1</a>
                            </li>
                            <li><a href="table_data_tables.html#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>商品分类ID</th>
                            <th>商品分类名</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <c:forEach items="${typeList}" var="type">
                                <tr>
                                    <td>${type.id}</td>
                                    <td>${type.typename}</td>
                                    <td>
                                        <a class="btn btn-info btn-xs" href="<%=application.getContextPath()%>/admin/goodsType/toUpdateGoodsType/${type.id}">修改</a>&nbsp;&nbsp;&nbsp;
                                        <a class="btn btn-danger btn-xs" url="<%=application.getContextPath()%>/admin/goodsType/deleteGoodsType/${type.id}" onclick="toDelete(this)">删除</a>
                                    </td>
                                </tr>
                            </c:forEach>
                        </tbody>
                        <tfoot>
                        <tr>
                            <th>商品分类ID</th>
                            <th>商品分类名</th>
                            <th>操作</th>
                        </tr>
                        </tfoot>
                    </table>

                </div>
            </div>
        </div>
    </div>
</div>
<script src="<%=application.getContextPath()%>/static/js/jquery.min.js?v=2.1.4"></script>
<script src="<%=application.getContextPath()%>/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="<%=application.getContextPath()%>/static/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="<%=application.getContextPath()%>/static/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="<%=application.getContextPath()%>/static/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="<%=application.getContextPath()%>/static/js/content.min.js?v=1.0.0"></script>
<script>
    $(document).ready(
        function(){
            $(".dataTables-example").dataTable();
            }
    );
    // 确定要删除吗？
    function toDelete(v) {
        let flag = confirm("确定要删除吗？")
        if (flag) {
            v.href = v.getAttribute("url");
        }
    }
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>

</body>

</html>
